<template>
	<div class="train">
		<trainHeader name="保险详情"></trainHeader>
		<div class="trainInsuranceTip">
			<div ref="box"></div>
		</div>
	</div>
</template>
<style scoped>
	.trainInsuranceTip {
		padding: 30px;
		font-size:20px;
		color:#8a8a8a;
		line-height:45px;
	}
</style>
<script>
	import trainHeader from "../../../components/trainHeader";
	export default {
		name: "trainInsuranceTip",
		data() { //数据
			return {
				message:"",
			}
		},
		mounted() {
			if (this.$route.params.message) {
				this.message = this.$route.params.message;
				var trainStore = JSON.parse(JSON.stringify(this.$store.state.train.trainStore));
				trainStore.trainInsuranceTip = this.message;
				this.$store.commit('TRAINSTORE', trainStore);
			} else {
				this.message = this.$store.state.train.trainStore.trainInsuranceTip;
			};
			this.$refs.box.innerHTML = this.message;
		},
		created() {

		},
		methods: {
			
		},
		beforeRouteLeave(to, from, next) {
			var trainStore = JSON.parse(JSON.stringify(this.$store.state.train.trainStore));
			trainStore.trainInsuranceTip = "";
			this.$store.commit('TRAINSTORE', trainStore);
			next();
		},
		components: {
			trainHeader
		},
	};
</script>